package com.utilities.hardware;


import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;

/**
 * <dependency>
 *     <groupId>com.github.dblock</groupId>
 *     <artifactId>oshi-core</artifactId>
 *     <version>LATEST</version>
 * </dependency>
 *
 * <!-- https://mvnrepository.com/artifact/org.fusesource/sigar -->
 * <dependency>
 *     <groupId>org.fusesource</groupId>
 *     <artifactId>sigar</artifactId>
 *     <version>1.6.4</version>
 * </dependency>
 *
 * <!-- https://mvnrepository.com/artifact/org.hyperic/sigar -->
 * <dependency>
 *     <groupId>org.hyperic</groupId>
 *     <artifactId>sigar</artifactId>
 *     <version>1.6.4</version>
 * </dependency>
 */
public abstract class SystemKit {
    private final static OperatingSystemMXBean JVM_BEAN = ManagementFactory.getOperatingSystemMXBean();

    private SystemKit() {}

    public static void cpuOverloadInfo(){
        System.out.println("负载信息："+JVM_BEAN.getSystemLoadAverage());
        System.out.println("CPU核心数:"+JVM_BEAN.getAvailableProcessors());

    }

    public static void main(String[] args) {
        cpuOverloadInfo();
    }

}
